package com.fhsk.file.common.enums;

/**
 * 字体颜色：1红、2橘、3蓝、4黑
 */
public enum WatermarkFontEnum {
    RED(1, "红"),
    ORANGE(2, "橘"),
    BLUE(3, "蓝"),
    BLACK(4, "黑");

    private final Integer code;
    private final String value;

    WatermarkFontEnum(Integer code, String value) {
        this.code = code;
        this.value = value;
    }

    public Integer getCode() {
        return code;
    }

    public String getValue() {
        return value;
    }

    /**
     * 获取指定参数code的枚举code值
     *
     * @param code
     * @return
     */
    public static Integer getWatermarkByCode(Integer code) {
        WatermarkFontEnum[] enums = WatermarkFontEnum.values();
        for (WatermarkFontEnum anEnum : enums) {
            if (anEnum.code.equals(code)) {
                return anEnum.code;
            }
        }
        return null;
    }
}
